/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-02-21 14:03:06
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\mixin\diyMixin.js
 * @CIMC-V2
 */
import { mapGetters } from 'vuex'
import isEmpty from 'lodash/isEmpty'
//主要使用范围是定制页面
export default {
  created: function () {},
  computed: {
    getHasPreview() {
      return this.$store.getters['preview/getHasPreview']
    },
    ...mapGetters('diy', [
      'getSelectModule',
      'getSelectModuleId',
      'getModules',
      'getPageModules',
      'getPageInfo',
      'getSettings',
      'getLayer',
      'getSelectLayer',
      'getSelectLayerId',
    ]),

    //判断选择模块是否有扩展信息
    hasEmptyExtension() {
      return isEmpty(this.getSelectModule.extension)
    },
    //判断选择模块是否有交互信息
    hasEmptyInteraction() {
      return this.getSelectModule.interaction == undefined
    },
    //判断是否有条件指令
    hasEmptyLogicInstruction() {
      return this.getSelectModule.logicInstruction == undefined
    },
    //判断是否有数据源绑定
    hasEmptyDataSourceBind() {
      return this.getSelectModule.dataSourceBind == undefined
    },
    //获取Module交互
    getModuleInteraction() {
      return this.getSelectModule.interaction
    },
    //获取Module交互
    getLayerInteraction() {
      return this.getSelectLayer.interaction
    },
    //获取Module条件
    getModuleLogicInstruction() {
      return this.getSelectModule.logicInstruction
    },
    //获取Module交互
    getLayerLogicInstruction() {
      return this.getSelectLayer.logicInstruction
    },
  },
  methods: {},
}
